#!/bin/bash
#PBS -q batch
#PBS -l walltime=24:00:00
#PBS -o {{= it.dagdir}}/{{= it.nodo.directorio}}/{{= it.nodo.nombre}}{{? it.config.times > 1 }}.$PBS_ARRAYID{{?}}.out
#PBS -e {{= it.dagdir}}/{{= it.nodo.directorio}}/{{= it.nodo.nombre}}{{? it.config.times > 1 }}.$PBS_ARRAYID{{?}}.err
#PBS -N {{= it.nodo.directorio}}_{{= it.nodo.nombre}}
{{?  it.nodo.dependencia && it.nodo.dependencia.length > 0 }}#PBS -W depend=afterok:{{= it.nodo.dependencia.join(":")}}{{?}}

{{? it.config.useDocker }}
docker run -it -v {{= it.dagdir}}/{{= it.nodo.directorio}}:{{= it.dagdir}}/{{= it.nodo.directorio}} --workdir {{= it.dagdir}}/{{= it.nodo.directorio}} {{= it.config.image }} {{= it.config.location && it.config.location.trim() }} {{= it.config.argumento.trim() }}
{{??}}
{{? it.config.module }}module load {{= it.config.module }}{{?}}
{{? it.config.wd }}cd {{= it.config.wd }}{{?}}
{{= it.config.location && it.config.location.trim() }} {{= it.config.argumento.trim() }}
{{?}}
